<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>设备管理系统</title>
        <link rel="shortcut icon" href="/ems/images/favicon.ico">
        <link href="/ems/css/bootstrap.min.css" rel="stylesheet">
		<link href="/ems/css/flat-ui.css" rel="stylesheet">
        <link href="/ems/css/flat-ui-green-theme.css" rel="stylesheet">
        <link href="/ems/css/ems.css" rel="stylesheet">
        <link type="text/css" href="/ems/css/jquery.jscrollpane.css" rel="stylesheet">
        <link type="text/css" href="/ems/css/temp/manageUser.css" rel="stylesheet">
	</head>

	<body>
    	<div class="scroll-pane">
            <ol class="breadcrumb">
                <li class="active-title"><span class="mark"></span>&nbsp;用户管理</li>
                <li class="button-pane">
                    <div class="search-group">
                        <input type="text" class="form-control search-field input-sm" value="" placeholder="用户名/账号搜索" id="search-role" name="key" />
                        <label class="search-field-icon fui-search" for="search-role"></label>
                    </div>
                    <a id="add-user" href="createUser.html" class="btn btn-primary btn-sm"><span class="fui-plus"></span>&nbsp;创建用户</a>
                    <a class="btn btn-primary btn-sm"><span class="batch-add"></span>&nbsp;批量创建</a>
                    <a id="batch-delete-user" class="btn btn-primary btn-sm disabled"><span class="fui-cross"></span>&nbsp;删除用户</a>
                </li>
            </ol>
            <table class="table table-hover">
                <thead>
                    <tr>
                        <th style="width:5%;" title="全选">
                            <input type="checkbox" value="" id="select-all" />
                        </th>
                        <th style="width:20%;">账号</th>
                        <th style="width:20%;">姓名</th>
                        <th style="width:10%;">性别</th>
                        <th style="width:20%;">等级</th>
                        <th style="width:25%;">操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr height="40px">
                        <td>
                            <input type="checkbox" value="" id="" />
                        </td>
                        <td>xzx1006</td>
                        <td>Xuzx</td>
                        <td>男</td>
                        <td>超级管理员</td>
                        <td>
                            <a id="find-user" href="#"><span class="fui-eye"></span>&nbsp;查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
                            <a id="update-user" href="#"><span class="fui-new"></span>&nbsp;编辑</a>&nbsp;&nbsp;&nbsp;&nbsp;
                            <a id="delete-user" href="#"><span class="fui-cross"></span>&nbsp;删除</a>&nbsp;&nbsp;&nbsp;&nbsp;
                            <a id="setting-user" href="#"><span class="fui-gear"></span>&nbsp;权限设置</a>&nbsp;&nbsp;&nbsp;&nbsp;
                        </td>
                    </tr>
                    <tr height="40px">
                        <td>
                            <input type="checkbox" value="" id="" />
                        </td>
                        <td>xxx0001</td>
                        <td>许学鑫</td>
                        <td>男</td>
                        <td>超级管理员</td>
                        <td>
                            <a id="find-role" href="#"><span class="fui-eye"></span>&nbsp;查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
                            <a id="update-role" href="#"><span class="fui-new"></span>&nbsp;编辑</a>&nbsp;&nbsp;&nbsp;&nbsp;
                            <a id="delete-role" href="#"><span class="fui-cross"></span>&nbsp;删除</a>&nbsp;&nbsp;&nbsp;&nbsp;
                            <a id="setting-user" href="#"><span class="fui-gear"></span>&nbsp;权限设置</a>&nbsp;&nbsp;&nbsp;&nbsp;
                        </td>
                    </tr>
                </tbody>
            </table>
            <div class="center">
                <ul class="pagination pagination-sm">
                    <li class="disabled"><a href="#">«</a></li>
                    <li class="active"><a href="#">1 <span class="sr-only">(current)</span></a></li>
                    <li><a href="#">2</a></li>
                    <li><a href="#">3</a></li>
                    <li><a href="#">4</a></li>
                    <li><a href="#">5</a></li>
                    <li><a href="#">»</a></li>
                </ul>
            </div>
            <div class="loading-pane center">
                <img src="images/loading.GIF">
            </div>
        </div>
        <script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
        <script type="text/javascript" src="js/jquery.mousewheel.js"></script>
        <script type="text/javascript" src="js/jquery.jscrollpane.min.js"></script>
        <script type="text/javascript">
        $(function(){
            /**
             * 初始化滚动面板
             **/
            $("div.scroll-pane").height($(document.body).height()).jScrollPane();
            $("div.jspPane").css("padding", "0 15px");
            
            /**
             * 初始化加载面板
             **/
            $("div.loading-pane").width($(document.body).width()).height($(document.body).height()).hide();

            /**
             * 全选复选框处理事件
             **/
            $("input#select-all").bind("change", function(){
                var _this = $(this);
                if(_this.is(":checked")){//选中
                    $("table.table tbody input:checkbox").attr("checked", "true");
                    $("a#batch-delete-role").removeClass("disabled");
                }else{
                    $("table.table tbody input:checkbox").removeAttr("checked");
                    $("a#batch-delete-role").addClass("disabled");
                }
            });

            /**
             * 子项复选框处理事件
             **/
            $("input#role-checkbox").bind("change", function(){
                var _this = $(this);
                var checkbox_num = $("table.table tbody input:checkbox").size();//总数目
                var checkbox_checked_num = $("table.table tbody input:checkbox:checked").size();//选中数目
                if(_this.is(":checked")){//选中
                    if(checkbox_num == checkbox_checked_num){
                        $("input#select-all").attr("checked", "true");
                    }
                    $("a#batch-delete-role").removeClass("disabled");
                }else{
                    if(0 >= checkbox_checked_num){
                        $("a#batch-delete-role").addClass("disabled");
                    }
                    $("input#select-all").removeAttr("checked");
                }
            }); 
            
            /**
             * 加载角色数据列表
             **/
            $.ajax({
		    	type: "POST",
		        url: "/ems/permissions/getRolesList",
		        cache: false,
		        data: {"pageNow":1,"maxCount":15},
		        dataType: "json",
		        beforeSend: function(){
		        	$("div.loading-pane").show();  
		        },
		   		complete: function(){
		   			$("div.loading-pane").hide();  
		        },
				success: function(json){
		        	//待接入服务器  
		        	     
		      	}
		    });
        });
        </script>
	</body>
</html>




